package com.tengju.support.domain.model.wx;

import lombok.AllArgsConstructor;

@AllArgsConstructor
public enum IsLeader {

    TRUE(1,"是上级"),
    FALSE(0,"非上级"),
    ;

    Integer val;
    String desc;

    public Integer getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    public static IsLeader fromVal(Integer val) {
        if (val == null) {
            return null;
        }
        for (IsLeader isLeader : values()) {
            if (isLeader.val.equals(val)) {
                return isLeader;
            }
        }
        return null;
    }
}
